package com.ileaf.proxy;

/**
 * @author Lianlb
 * @date 2019-04-18 11:00
 */
public class StaticProxy implements IHello {

    private IHello hello;

    public StaticProxy() {
    }

    public StaticProxy(IHello hello) {
        this.hello = hello;
    }

    @Override
    public void sayHello(String name) {
        System.out.println("问候执行之前添加日志...");
        hello.sayHello(name);
    }

    @Override
    public void sayGoodBye(String name) {
        System.out.println("再见执行之前添加日志...");
        hello.sayGoodBye(name);
    }

    public void setHello(IHello hello) {
        this.hello = hello;
    }
}
